﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using Models;

namespace BLL
{
    public class ProductBLL
    {
        /// <summary>
        /// ProductInfo查询返回给DAL
        /// </summary>
        /// <returns></returns>
        public static DataTable dat() {
            return ProductDAL.dat();
        }
        /// <summary>
        /// 删除商品返回给DAL
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static bool s(int id) {
            return ProductDAL.S(id);
        }
        //Productclass查询返回给DAL
        public static DataTable Cha() {
            return ProductDAL.GetData();
        }
        /// <summary>
        /// ProductInfo增加数据返回给DAL
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        public static bool Inster(Product p) {
            return ProductDAL.ins(p);
        }
        /// <summary>
        /// productinfo修改填充返回给DAL
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        public static Product p(string s) {
            return ProductDAL.p(s);
        }
        /// <summary>
        /// ProductInfo修改数据返回给DAL
        /// </summary>
        /// <param name="p"></param>
        /// <param name="s"></param>
        /// <returns></returns>
        public static bool XiuGai(Product p, int s){
            return ProductDAL.Update(p, s);
        }
    }
}
